Proper connect_port
[juce-lv2.git] / juce / source / extras / the jucer / src / ui / jucer_ComponentLayoutEditor.h
blob040308381c5b58be59753dd05a96b4a33c67c250
1 /*
2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-11 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #ifndef __JUCER_COMPONENTLAYOUTEDITOR_JUCEHEADER__
27 #define __JUCER_COMPONENTLAYOUTEDITOR_JUCEHEADER__
29 #include "jucer_ComponentOverlayComponent.h"
30 #include "../model/jucer_JucerDocument.h"
31 #include "jucer_SnapGridPainter.h"
34 //==============================================================================
35 /**
37 class ComponentLayoutEditor : public Component,
38 public ChangeListener,
39 public FileDragAndDropTarget,
40 public LassoSource <Component*>
42 public:
43 //==============================================================================
44 ComponentLayoutEditor (JucerDocument& document, ComponentLayout& layout);
45 ~ComponentLayoutEditor();
47 //==============================================================================
48 void paint (Graphics& g);
49 void resized();
50 void visibilityChanged();
51 void changeListenerCallback (ChangeBroadcaster*);
53 void mouseDown (const MouseEvent& e);
54 void mouseDrag (const MouseEvent& e);
55 void mouseUp (const MouseEvent& e);
56 bool keyPressed (const KeyPress& key);
58 bool isInterestedInFileDrag (const StringArray& files);
59 void filesDropped (const StringArray& filenames, int x, int y);
61 ComponentLayout& getLayout() const throw() { return layout; }
63 void findLassoItemsInArea (Array <Component*>& results, const Rectangle<int>& area);
65 SelectedItemSet <Component*>& getLassoSelection();
67 //==============================================================================
68 void refreshAllComponents();
69 void updateOverlayPositions();
71 ComponentOverlayComponent* getOverlayCompFor (Component* comp) const;
73 const Rectangle<int> getComponentArea() const;
75 const Image createComponentLayerSnapshot() const;
77 private:
78 JucerDocument& document;
79 ComponentLayout& layout;
80 Component* subCompHolder;
82 LassoComponent <Component*> lassoComp;
83 SnapGridPainter grid;
84 bool firstResize;
88 #endif // __JUCER_COMPONENTLAYOUTEDITOR_JUCEHEADER__